//Copyright 2008, 2009, 2010 Miguel Ángel Laguna Lobato
//
//This file is part of Multiclinical Trial Web-PACS.
//
//Multiclinical  Trial Web-PACS is free  software: you  can redistribute 
//it and/or modify it under  the terms of the GNU General Public License 
//as published by the Free  Software Foundation, either version 3 of the 
//License, or (at your option) any later version.
//
//Multiclinical  Trial Web-PACS is distributed  in the hope that it will 
//be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
//of  MERCHANTABILITY or  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
//General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with Multiclinical Trial Web-PACS.  If not, see 
//<http://www.gnu.org/licenses/>.

package es.urjc.mctwp.modelo;

import java.util.ArrayList;
import java.util.List;

// Generated 02-jun-2007 10:15:29 by Hibernate Tools 3.2.0.b9

/**
 * Menu generated by hbm2java
 */
public class Menu extends DomainObject implements java.io.Serializable {

	private static final long serialVersionUID = -4887398527389301839L;
	private String text;
	private Action action = null;
	private Menu   parent = null;
	private List<Menu> childs = null; //This property is not mapped, it is used by the application

	public Menu() {
		childs = new ArrayList<Menu>();
	}

	public String getText() {
		return this.text;
	}

	public void setText(String texto) {
		this.text = texto;
	}

	public void setAction(Action action) {
		this.action = action;
	}

	public Action getAction() {
		return action;
	}

	public void setParent(Menu parent) {
		this.parent = parent;
	}

	public Menu getParent() {
		return parent;
	}

	public List<Menu> getChilds() {
		return childs;
	}
	
	public void addChild(Menu item){
		childs.add(item); 
	}
}
